package lambda;

public class Test2 {
    public static void main(String[] args) {
        Interface itf= Integer::sum;        //a+b
        Interface itf1= (a,b)->a-b;
        Interface itf2=(a,b)->{return a*b;};
        System.out.println(itf.dNum(1,2));
        System.out.println(itf1.dNum(4,1));
        System.out.println(itf2.dNum(2,3));
        new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("aaaaaaf");
            }
        }).start();
        new Thread(()-> {
            while(true){
                System.out.println("a");
                try {
                    Thread.sleep(100);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }).start();

    }

}
